﻿Imports Microsoft.VisualBasic

Public Class ImapClient_Event

    Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
        If rdoEmailRx.Checked = True Or rdoEmailSent.Checked = True Then

            If rdoEmailRx.Checked = True Then
                ImapClientDemo.MessageViewer.EventType = rdoEmailRx.Text
            ElseIf rdoEmailSent.Checked = True Then
                ImapClientDemo.MessageViewer.EventType = rdoEmailSent.Text
            End If
            Me.Dispose()
        Else
            MsgBox("Please select event type", MsgBoxStyle.Information, "Event Type")
        End If
    End Sub

    Private Sub ImapClient_Event_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If ImapClientDemo.MessageViewer.EventType = String.Empty Then
            e.Cancel = True
        End If
    End Sub
End Class
